package be.nepherte.movmanager.server.util;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;

/**
 * This class is a singleton wrapper class holding a persistence factory instance.
 * Creating such a persistence factory instance takes a lot of time and is
 * therefore stored in this class. This instance can be used by multiple
 * requests and multiple classes.
 * 
 * <p>
 * This file is part of MovManager.
 * </p>
 * <p>
 * MovManager is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * </p>
 * <p>
 * MovManager is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * </p>
 * <p>
 * You should have received a copy of the GNU General Public License along with
 * MovManager. If not, see <a
 * href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses</a>.
 * </p>
 * 
 * @author	Bart Verhoeven
 * @version	0.1
 */
public final class PersistenceContext {
	/**A persistence manager factory instance*/
    private static final PersistenceManagerFactory pmfInstance = JDOHelper.getPersistenceManagerFactory("transactions-optional");

    /**
     * Default empty constructor for this class.
     */
    private PersistenceContext() {}

    /**
     * Retrieves a persistence manager factory instance.
     * 
     * @return	pfmInstance
     */
    public static PersistenceManagerFactory getPersistenceManagagerFactory() {
        return pmfInstance;
    }
}
